version 12
capture log close
log using "D:\shale_job\shalejob_tx", replace

/* Project: Green Jobs v.s. Shale Jobs */
/* Data: employment and wells completed data of Texas */
/* Xinya Zhang, Oct,2012 */

clear all
/* set memory ?m */
use "D:\shale_job\tx_county_emp_wells"

xtset county year

/* Fixed effect model */
xtreg emp wells, fe
xtreg emp gas oil others if wells > 0, fe

/*
Two-way fixed effects model
*/
xtreg emp wells i.year, fe
estimates store fixed
xtreg emp gas oil others i.year if wells > 0, fe


/* Two-way random effects model */
xtreg emp wells i.year, re

/* Hausman test: choose between fixed and random effects */
hausman fixed ., sigmamore

log close

/* The command below is for generating log in tex form to put into latex file */
/* sjlog using "D:\shale_job\shalejob_tx", replace */

/* sjlog close */




